package hu.elte.tudaskezelo.dbpedialike.domain;

import android.os.Parcel;
import android.os.Parcelable;

public class CityFind implements Parcelable, Parcelable.Creator<CityFind> {

	private Double longitude;
	private Double latitude;
	private String cityName;
	private String countryName;

	public CityFind() {

	}

	public CityFind(Double longitude, Double latitude, String cityName,
			String countryName) {
		this.longitude = longitude;
		this.latitude = latitude;
		this.cityName = cityName;
		this.countryName = countryName;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {

		dest.writeString(cityName);
		dest.writeString(countryName);
		dest.writeDouble(longitude);
		dest.writeDouble(latitude);

	}

	public CityFind(Parcel in) {
		cityName = in.readString();
		countryName = in.readString();
		longitude = in.readDouble();
		latitude = in.readDouble();

	}

	@Override
	public CityFind createFromParcel(Parcel source) {
		return new CityFind(source);
	}

	@Override
	public CityFind[] newArray(int size) {
		return new CityFind[size];
	}

	public Double getLongitude() {
		return longitude;
	}

	public void setLongitude(Double longitude) {
		this.longitude = longitude;
	}

	public Double getLatitude() {
		return latitude;
	}

	public void setLatitude(Double latitude) {
		this.latitude = latitude;
	}

	public String getCityName() {
		return cityName;
	}

	public void setCityName(String cityName) {
		this.cityName = cityName;
	}

	public String getCountryName() {
		return countryName;
	}

	public void setCountryName(String countryName) {
		this.countryName = countryName;
	}

	//Nem szabad generálással felülírni....
	@Override
	public String toString() {
		return cityName + ", " + countryName + " (" + longitude + ", "
				+ latitude + ")";
	}

}
